network_client.h
author bjarni
Thu, 05 Oct 2006 12:59:28 +0000
changeset 4739 e626ef1b522e
parent 2436 7d5df545bd5d
permissions -rw-r--r--
(svn r6651) -Coding feature: added the windowevent WE_INVALIDATE_DATA
This gives the ability to invalidate some window data and recalculate as needed instead of doing it for each WE_PAINT

This event is called right away when using InvalidateWindowData(), so it may be a good idea to set a bool or similar in the window
or similar and then act on that bool in WE_PAINT instead of doing a lot of stuff in WE_INVALIDATE_DATA as it might be called more than once before WE_PAINT is called

InvalidateWindowData() will not automatically repaint the window, so if you want to repaint it as well, you need to mark it dirty as well.

Made the depot windows use WE_INVALIDATE_DATA to set when to generate the engine and wagon lists instead of at each redraw
It makes no sense to regenerate the list when say using the scrollbar if we know that no vehicle have entered or left the list

NOTE: currently there is a piece of code to generate the list when it's not needed and compare it to the stored list and assert if they mismatch
This check is somewhat slow and kills the whole idea of WE_INVALIDATE_DATA, so it's a short lived one to verify that InvalidateWindowData() is used everywhere where it's needed
2186
db48cf29b983 (svn r2701) Insert Id tags into all source files
tron
parents: 1026
diff changeset
     1
/* $Id$ */
db48cf29b983 (svn r2701) Insert Id tags into all source files
tron
parents: 1026
diff changeset
     2
543
946badd71033 (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
     3
#ifndef NETWORK_CLIENT_H
946badd71033 (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
     4
#define NETWORK_CLIENT_H
946badd71033 (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
     5
946badd71033 (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
     6
#ifdef ENABLE_NETWORK
946badd71033 (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
     7
946badd71033 (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
     8
DEF_CLIENT_SEND_COMMAND(PACKET_CLIENT_GAME_INFO);
946badd71033 (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
     9
DEF_CLIENT_SEND_COMMAND(PACKET_CLIENT_COMPANY_INFO);
946badd71033 (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
    10
DEF_CLIENT_SEND_COMMAND_PARAM(PACKET_CLIENT_COMMAND)(CommandPacket *cp);
946badd71033 (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
    11
DEF_CLIENT_SEND_COMMAND_PARAM(PACKET_CLIENT_ERROR)(NetworkErrorCode errorno);
946badd71033 (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
    12
DEF_CLIENT_SEND_COMMAND_PARAM(PACKET_CLIENT_QUIT)(const char *leavemsg);
946badd71033 (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
    13
DEF_CLIENT_SEND_COMMAND_PARAM(PACKET_CLIENT_CHAT)(NetworkAction action, DestType desttype, int dest, const char *msg);
946badd71033 (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
    14
DEF_CLIENT_SEND_COMMAND_PARAM(PACKET_CLIENT_PASSWORD)(NetworkPasswordType type, const char *password);
946badd71033 (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
    15
DEF_CLIENT_SEND_COMMAND_PARAM(PACKET_CLIENT_SET_PASSWORD)(const char *password);
946badd71033 (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
    16
DEF_CLIENT_SEND_COMMAND_PARAM(PACKET_CLIENT_SET_NAME)(const char *name);
946badd71033 (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
    17
DEF_CLIENT_SEND_COMMAND(PACKET_CLIENT_ACK);
1026
02cc18821508 (svn r1527) -Add: RCon (Remote Connection). A server can set:
truelight
parents: 716
diff changeset
    18
DEF_CLIENT_SEND_COMMAND_PARAM(PACKET_CLIENT_RCON)(const char *pass, const char *command);
543
946badd71033 (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
    19
716
8af847728d5b (svn r1168) -Cleanup: [Network] Cleaned the network code a bit. Added 'const'
truelight
parents: 543
diff changeset
    20
NetworkRecvStatus NetworkClient_ReadPackets(NetworkClientState *cs);
543
946badd71033 (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
    21
void NetworkClient_Connected(void);
946badd71033 (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
    22
946badd71033 (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
    23
#endif /* ENABLE_NETWORK */
946badd71033 (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
    24
2436
7d5df545bd5d (svn r2962) - const correctness for all Get* functions and most Draw* functions that don't change their pointer parameters
Darkvater
parents: 2186
diff changeset
    25
#endif /* NETWORK_CLIENT_H */