no message

git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@616 e016b1c5-ed68-44aa-a2f7-31cac88cffde
This commit is contained in:
driAn
2006-11-12 20:01:46 +00:00
parent 2a0dc62900
commit 1f4113377f
6 changed files with 21 additions and 10 deletions
+10 -1
View File
@@ -214,8 +214,8 @@ void addmsg(int type, const char *fmt, ...)
int lastupdate = 0, lastping = 0;
bool senditemstoserver = false; // after a map change, since server doesn't have map data
bool sendpwd = false;
string clientpassword;
char *toserverpwd = NULL;
void password(char *p) { s_strcpy(clientpassword, p); };
COMMAND(password, ARG_1STR);
@@ -250,6 +250,15 @@ void c2sinfo(dynent *d) // send update to the server
ENetPacket *packet = enet_packet_create(NULL, 100, 0);
ucharbuf q(packet->data, packet->dataLength);
if(sendpwd && clientpassword[0])
{
packet->flags = ENET_PACKET_FLAG_RELIABLE;
putint(q, SV_PWD);
sendstring(clientpassword, q);
clientpassword[0] = 0; // avoid sending pwd to other servers on connect
sendpwd = false;
};
putint(q, SV_POS);
putint(q, clientnum);
putuint(q, (int)(d->o.x*DMF)); // quantize coordinates to 1/16th of a cube, between 1 and 3 bytes