- static float keyrefreshdelay=0,bigrefreshdelay=0;
-
- //Net updates
-
- /*keyrefreshdelay-=multiplier;
- bigrefreshdelay-=multiplier;
-
- if(keyrefreshdelay<=0){
- static int concat[4];
-
- concat[0]=player[0].forwardkeydown;
- concat[0]=concat[0]*2+player[0].forwardstogglekeydown;
- concat[0]=concat[0]*2+player[0].rightkeydown;
- concat[0]=concat[0]*2+player[0].leftkeydown;
- concat[0]=concat[0]*2+player[0].backkeydown;
- concat[0]=concat[0]*2+player[0].jumpkeydown;
- concat[0]=concat[0]*2+player[0].jumptogglekeydown;
- concat[0]=concat[0]*2+player[0].crouchkeydown;
-
- concat[1]=player[0].crouchtogglekeydown;
- concat[1]=concat[1]*2+player[0].drawkeydown;
- concat[1]=concat[1]*2+player[0].drawtogglekeydown;
- concat[1]=concat[1]*2+player[0].throwkeydown;
- concat[1]=concat[1]*2+player[0].throwtogglekeydown;
- concat[1]=concat[1]*2+player[0].attackkeydown;
-
- //concat[2]=(char)((int)(rotation/2)%180);
-
- //concat[3]=(char)((int)(rotation2/2)%180);
-
- chatname[0]=concat[0]-128;
- chatname[1]=concat[1]-128;
- //chatname[2]=concat[2]-128;
- //chatname[3]=concat[3]-128;
- int temppoint=2;
- memcpy(chatname+temppoint,&rotation,sizeof(float));
- temppoint+=sizeof(float);
- memcpy(chatname+temppoint,&rotation2,sizeof(float));
- temppoint+=sizeof(float);
-
- chatname[temppoint]='\0';
-
- //if(!ishost)NetworkSendPlayerMessage( chatname, kMessageType_Keys );
- //if(ishost)NetworkSendPlayerRelayMessage( chatname, kMessageType_Keys );
- //keyrefreshdelay=.01;
- keyrefreshdelay=.03;
- }
-
- if(bigrefreshdelay<=0){
- for(i=0;i<1;i++){
- /*int temppoint=0;
- memcpy(chatname+temppoint,&i,sizeof(int));
- temppoint+=sizeof(int);
- memcpy(chatname+temppoint,&player[i].coords.x,sizeof(float));
- temppoint+=sizeof(float);
- memcpy(chatname+temppoint,&player[i].coords.y,sizeof(float));
- temppoint+=sizeof(float);
- memcpy(chatname+temppoint,&player[i].coords.z,sizeof(float));
- temppoint+=sizeof(float);
- memcpy(chatname+temppoint,&player[i].damage,sizeof(float));
- temppoint+=sizeof(float);
- memcpy(chatname+temppoint,&player[i].target,sizeof(float));
- temppoint+=sizeof(float);
- memcpy(chatname+temppoint,&player[i].targetanimation,sizeof(int));
- temppoint+=sizeof(int);
- memcpy(chatname+temppoint,&player[i].currentanimation,sizeof(int));
- temppoint+=sizeof(int);
- memcpy(chatname+temppoint,&player[i].velocity.x,sizeof(float));
- temppoint+=sizeof(float);
- memcpy(chatname+temppoint,&player[i].velocity.y,sizeof(float));
- temppoint+=sizeof(float);
- memcpy(chatname+temppoint,&player[i].velocity.z,sizeof(float));
- temppoint+=sizeof(float);
- memcpy(chatname+temppoint,&player[i].targetframe,sizeof(int));
- temppoint+=sizeof(int);
- memcpy(chatname+temppoint,&player[i].currentframe,sizeof(int));
- temppoint+=sizeof(int);
- memcpy(chatname+temppoint,&player[i].rotation,sizeof(float));
- temppoint+=sizeof(float);
- memcpy(chatname+temppoint,&player[i].targetrotation,sizeof(float));
- temppoint+=sizeof(float);
- memcpy(chatname+temppoint,&player[i].bloodloss,sizeof(float));
- temppoint+=sizeof(float);
- memcpy(chatname+temppoint,&player[i].weaponactive,sizeof(int));
- temppoint+=sizeof(int);
- memcpy(chatname+temppoint,&player[i].num_weapons,sizeof(int));
- temppoint+=sizeof(int);
- memcpy(chatname+temppoint,&player[i].weaponids[0],sizeof(int));
- temppoint+=sizeof(int);
- memcpy(chatname+temppoint,&player[i].weaponids[1],sizeof(int));
- temppoint+=sizeof(int);
- memcpy(chatname+temppoint,&player[i].weaponids[2],sizeof(int));
- temppoint+=sizeof(int);
- memcpy(chatname+temppoint,&player[i].weaponids[3],sizeof(int));
- temppoint+=sizeof(int);
- chatname[temppoint]='\0';
-
- sprintf (chatname, "%d %f %f %f %f %f %d %d %f %f %f %d %d %f %f %f",i,player[i].coords.x,player[i].coords.y,player[i].coords.z,player[i].damage,player[i].target, player[i].targetanimation, player[i].currentanimation, player[i].velocity.x, player[i].velocity.y, player[i].velocity.z, player[i].targetframe, player[i].currentframe, player[i].rotation, player[i].targetrotation);
- //if(ishost)NetworkSendPlayerRelayMessage( chatname, kMessageType_PlayerState );
- //else NetworkSendPlayerMessage( chatname, kMessageType_PlayerState );
-
- sprintf (chatname, "%d %f %d %d %d %d %d %d %d %d %f",i,player[i].bloodloss, player[i].weaponactive, player[i].num_weapons, player[i].weaponids[0], player[i].weaponids[1], player[i].weaponids[2], player[i].weaponids[3],player[i].dead,player[i].skeleton.free,player[i].permanentdamage);
-
- //if(ishost)NetworkSendPlayerRelayMessage( chatname, kMessageType_PlayerStateMisc );
- //else NetworkSendPlayerMessage( chatname, kMessageType_PlayerStateMisc );
- }
- //bigrefreshdelay=.02;
- bigrefreshdelay=.1;
- }
- }*/