diff options
author | skotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2006-09-13 15:36:38 +0000 |
---|---|---|
committer | skotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2006-09-13 15:36:38 +0000 |
commit | a73bf03c82495f4ff0fe7c2f757ef20415f9ede5 (patch) | |
tree | 209234ac8d5e35e0a13428075aab1cb0da032313 /src/char/char.c | |
parent | 880de4edc72449ec92c1ed374e3f9ef1e5b290c3 (diff) | |
download | hercules-a73bf03c82495f4ff0fe7c2f757ef20415f9ede5.tar.gz hercules-a73bf03c82495f4ff0fe7c2f757ef20415f9ede5.tar.bz2 hercules-a73bf03c82495f4ff0fe7c2f757ef20415f9ede5.tar.xz hercules-a73bf03c82495f4ff0fe7c2f757ef20415f9ede5.zip |
- Modified the char-server TXT whisper system to use the online_db to know to which map server forward whispers, instead of just sending the whisper to every map server.
- Added char-server functions search_character_byname() and search_character_online() required for the previous update.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@8732 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/char/char.c')
-rw-r--r-- | src/char/char.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/char/char.c b/src/char/char.c index 2ae226ca1..50586a921 100644 --- a/src/char/char.c +++ b/src/char/char.c @@ -216,6 +216,13 @@ struct mmo_charstatus* search_character(int aid, int cid) { return NULL;
}
+struct mmo_charstatus* search_character_byname(char* character_name)
+{
+ int i = search_character_index(character_name);
+ if (i == -1) return NULL;
+ return &char_dat[i].status;
+}
+
//----------------------------------------------
// Search an character id
// (return character index or -1 (if not found))
@@ -259,6 +266,19 @@ char * search_character_name(int index) { return unknown_char_name;
}
+// Searches if the given character is online, and returns the fd of the
+// map-server it is connected to.
+int search_character_online(int aid, int cid)
+{
+ //Look for online character.
+ struct online_char_data* character;
+ character = idb_get(online_char_db, aid);
+ if(character &&
+ character->char_id == cid &&
+ character->server > -1)
+ return server_fd[character->server];
+ return -1;
+}
static void * create_online_char_data(DBKey key, va_list args) {
struct online_char_data* character;
character = aCalloc(1, sizeof(struct online_char_data));
|