hedgewars/uFLNetTypes.pas
author unc0rr
Wed, 18 Nov 2015 22:18:39 +0300
branchqmlfrontend
changeset 11413 ffff8a0d1a76
parent 10953 360e57620df3
child 11418 091149424aa4
permissions -rw-r--r--
Implement processing net commands in the main thread
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
10953
360e57620df3 Put types into a separate file
unc0rr
parents:
diff changeset
     1
unit uFLNetTypes;
360e57620df3 Put types into a separate file
unc0rr
parents:
diff changeset
     2
interface
360e57620df3 Put types into a separate file
unc0rr
parents:
diff changeset
     3
11413
ffff8a0d1a76 Implement processing net commands in the main thread
unc0rr
parents: 10953
diff changeset
     4
type TCmdType = (cmd_ASKPASSWORD, cmd_BANLIST, cmd_BANLIST_s, cmd_BYE, cmd_CHAT,
ffff8a0d1a76 Implement processing net commands in the main thread
unc0rr
parents: 10953
diff changeset
     5
    cmd_CLIENT_FLAGS, cmd_CLIENT_FLAGS_s, cmd_CONNECTED, cmd_EM, cmd_EM_s,
ffff8a0d1a76 Implement processing net commands in the main thread
unc0rr
parents: 10953
diff changeset
     6
    cmd_ERROR, cmd_HH_NUM, cmd_HH_NUM_s, cmd_INFO, cmd_INFO_s, cmd_JOINED,
ffff8a0d1a76 Implement processing net commands in the main thread
unc0rr
parents: 10953
diff changeset
     7
    cmd_JOINED_s, cmd_JOINING, cmd_KICKED, cmd_LEFT, cmd_LEFT_s, cmd_LOBBY_JOINED,
ffff8a0d1a76 Implement processing net commands in the main thread
unc0rr
parents: 10953
diff changeset
     8
    cmd_LOBBY_JOINED_s, cmd_LOBBY_LEFT, cmd_NICK, cmd_NOTICE, cmd_PING, cmd_PING_s,
ffff8a0d1a76 Implement processing net commands in the main thread
unc0rr
parents: 10953
diff changeset
     9
    cmd_PROTO, cmd_ROOMS, cmd_ROOMS_s, cmd_ROUND_FINISHED, cmd_RUN_GAME,
ffff8a0d1a76 Implement processing net commands in the main thread
unc0rr
parents: 10953
diff changeset
    10
    cmd_SERVER_AUTH, cmd_SERVER_MESSAGE, cmd_SERVER_VARS, cmd_TEAM_ACCEPTED,
ffff8a0d1a76 Implement processing net commands in the main thread
unc0rr
parents: 10953
diff changeset
    11
    cmd_TEAM_COLOR, cmd_TEAM_COLOR_s, cmd_WARNING);
ffff8a0d1a76 Implement processing net commands in the main thread
unc0rr
parents: 10953
diff changeset
    12
ffff8a0d1a76 Implement processing net commands in the main thread
unc0rr
parents: 10953
diff changeset
    13
    type TCmdParam = packed record
ffff8a0d1a76 Implement processing net commands in the main thread
unc0rr
parents: 10953
diff changeset
    14
        cmd: TCmdType;
ffff8a0d1a76 Implement processing net commands in the main thread
unc0rr
parents: 10953
diff changeset
    15
        end;
ffff8a0d1a76 Implement processing net commands in the main thread
unc0rr
parents: 10953
diff changeset
    16
    type TCmdParamL = packed record
ffff8a0d1a76 Implement processing net commands in the main thread
unc0rr
parents: 10953
diff changeset
    17
        cmd: TCmdType;
ffff8a0d1a76 Implement processing net commands in the main thread
unc0rr
parents: 10953
diff changeset
    18
        str1: string;
ffff8a0d1a76 Implement processing net commands in the main thread
unc0rr
parents: 10953
diff changeset
    19
        end;
ffff8a0d1a76 Implement processing net commands in the main thread
unc0rr
parents: 10953
diff changeset
    20
    type TCmdParamS = packed record
ffff8a0d1a76 Implement processing net commands in the main thread
unc0rr
parents: 10953
diff changeset
    21
        cmd: TCmdType;
ffff8a0d1a76 Implement processing net commands in the main thread
unc0rr
parents: 10953
diff changeset
    22
        str1: shortstring;
ffff8a0d1a76 Implement processing net commands in the main thread
unc0rr
parents: 10953
diff changeset
    23
        end;
ffff8a0d1a76 Implement processing net commands in the main thread
unc0rr
parents: 10953
diff changeset
    24
    type TCmdParamSL = packed record
ffff8a0d1a76 Implement processing net commands in the main thread
unc0rr
parents: 10953
diff changeset
    25
        cmd: TCmdType;
ffff8a0d1a76 Implement processing net commands in the main thread
unc0rr
parents: 10953
diff changeset
    26
        str1: shortstring;
ffff8a0d1a76 Implement processing net commands in the main thread
unc0rr
parents: 10953
diff changeset
    27
        str2: string;
ffff8a0d1a76 Implement processing net commands in the main thread
unc0rr
parents: 10953
diff changeset
    28
        end;
ffff8a0d1a76 Implement processing net commands in the main thread
unc0rr
parents: 10953
diff changeset
    29
    type TCmdParami = packed record
ffff8a0d1a76 Implement processing net commands in the main thread
unc0rr
parents: 10953
diff changeset
    30
        cmd: TCmdType;
ffff8a0d1a76 Implement processing net commands in the main thread
unc0rr
parents: 10953
diff changeset
    31
        param1: LongInt;
ffff8a0d1a76 Implement processing net commands in the main thread
unc0rr
parents: 10953
diff changeset
    32
        end;
ffff8a0d1a76 Implement processing net commands in the main thread
unc0rr
parents: 10953
diff changeset
    33
10953
360e57620df3 Put types into a separate file
unc0rr
parents:
diff changeset
    34
    TCmdData = record
360e57620df3 Put types into a separate file
unc0rr
parents:
diff changeset
    35
                   case byte of
11413
ffff8a0d1a76 Implement processing net commands in the main thread
unc0rr
parents: 10953
diff changeset
    36
                       0: (cmd: TCmdParam);
ffff8a0d1a76 Implement processing net commands in the main thread
unc0rr
parents: 10953
diff changeset
    37
                       1: (cpl: TCmdParamL);
ffff8a0d1a76 Implement processing net commands in the main thread
unc0rr
parents: 10953
diff changeset
    38
                       2: (cps: TCmdParamS);
ffff8a0d1a76 Implement processing net commands in the main thread
unc0rr
parents: 10953
diff changeset
    39
                       3: (cpsl: TCmdParamSL);
ffff8a0d1a76 Implement processing net commands in the main thread
unc0rr
parents: 10953
diff changeset
    40
                       4: (cpi: TCmdParami);
10953
360e57620df3 Put types into a separate file
unc0rr
parents:
diff changeset
    41
               end;
360e57620df3 Put types into a separate file
unc0rr
parents:
diff changeset
    42
360e57620df3 Put types into a separate file
unc0rr
parents:
diff changeset
    43
implementation
360e57620df3 Put types into a separate file
unc0rr
parents:
diff changeset
    44
360e57620df3 Put types into a separate file
unc0rr
parents:
diff changeset
    45
end.