Changeset 203


Ignore:
Timestamp:
May 18, 2018, 12:54:37 AM (6 years ago)
Author:
chronos
Message:
  • Fixed: Player turn start/end signaling from server to clients.
  • Added: Save action to save game without opening save dialog.
  • Fixed: Move dialog was not opened after new game was created.
Location:
trunk
Files:
1 added
15 edited

Legend:

Unmodified
Added
Removed
  • trunk/Forms/UFormClient.lfm

    r202 r203  
    11object FormClient: TFormClient
    2   Left = 418
     2  Left = 662
    33  Height = 621
    4   Top = 253
     4  Top = 413
    55  Width = 775
    66  Caption = 'Client'
    77  ClientHeight = 621
    88  ClientWidth = 775
    9   DesignTimePPI = 120
     9  DesignTimePPI = 144
    1010  OnClose = FormClose
    1111  OnCreate = FormCreate
     
    1717  object StatusBar1: TStatusBar
    1818    Left = 0
    19     Height = 28
    20     Top = 593
     19    Height = 30
     20    Top = 591
    2121    Width = 775
    2222    Panels = <   
     
    3434  object ToolBar1: TToolBar
    3535    Left = 0
    36     Height = 593
     36    Height = 591
    3737    Top = 0
    3838    Width = 32
     
    7575  object PaintBox1: TPaintBox
    7676    Left = 32
    77     Height = 593
     77    Height = 591
    7878    Top = 0
    7979    Width = 743
     
    132132      ImageIndex = 0
    133133      OnExecute = AGameEndTurnExecute
     134      ShortCut = 16468
    134135    end
    135136  end
  • trunk/Forms/UFormClient.pas

    r202 r203  
    7676    LastTimerTime: TDateTime;
    7777    TimerPeriod: TDateTime;
     78    TurnActive: Boolean;
    7879    procedure SetClient(AValue: TClient);
    7980    procedure DoClientChange(Sender: TObject);
    80     procedure DoOnMove(CellFrom, CellTo: TCell; var CountOnce,
     81    procedure DoTurnStart(Sender: TObject);
     82    procedure DoMove(CellFrom, CellTo: TCell; var CountOnce,
    8183      CountRepeat: Integer; Update: Boolean; var Confirm: Boolean);
    8284  public
    8385    procedure LoadConfig(Config: TXmlConfig; Path: string);
    8486    procedure SaveConfig(Config: TXmlConfig; Path: string);
    85     procedure ReloadView;
     87    procedure UpdateInterface;
    8688    procedure Redraw;
    8789    property Client: TClient read FClient write SetClient;
     
    103105{ TFormClient }
    104106
    105 procedure TFormClient.DoOnMove(CellFrom, CellTo: TCell; var CountOnce,
     107procedure TFormClient.DoMove(CellFrom, CellTo: TCell; var CountOnce,
    106108  CountRepeat: Integer; Update: Boolean; var Confirm: Boolean);
    107109var
     
    210212    FClient.Form := Self;
    211213    FClient.OnChange := DoClientChange;
    212     FClient.OnMove := DoOnMove;
     214    FClient.OnMove := DoMove;
     215    FClient.OnTurnStart := DoTurnStart();
    213216  end;
    214217  Redraw;
     
    218221begin
    219222  Redraw;
     223end;
     224
     225procedure TFormClient.DoTurnStart(Sender: TObject);
     226begin
     227  TurnActive := True;
     228  UpdateInterface;
    220229end;
    221230
     
    238247end;
    239248
    240 procedure TFormClient.ReloadView;
     249procedure TFormClient.UpdateInterface;
    241250begin
    242251  if AToolBarBigIcons.Checked then begin
     
    255264  ToolBar1.Visible := AToolBarVisible.Checked;
    256265  StatusBar1.Visible := AStatusBarVisible.Checked;
     266  AGameEndTurn.Enabled := TurnActive;
    257267end;
    258268
     
    295305begin
    296306  AToolBarBigIcons.Checked := not AToolBarBigIcons.Checked;
    297   ReloadView;
     307  UpdateInterface;
    298308end;
    299309
     
    301311begin
    302312  AStatusBarVisible.Checked := not AStatusBarVisible.Checked;
    303   ReloadView;
     313  UpdateInterface;
    304314end;
    305315
    306316procedure TFormClient.AGameEndTurnExecute(Sender: TObject);
    307 var
    308   P: TGameProtocolClient;
    309   P2: TCommPin;
    310 begin
    311   P := Client.Protocol;
    312   P2 := P.Pin;
     317begin
     318  TurnActive := False;
    313319  Client.Protocol.TurnEnd;
     320  UpdateInterface;
    314321end;
    315322
     
    317324begin
    318325  AToolBarVisible.Checked := not AToolBarVisible.Checked;
    319   ReloadView;
     326  UpdateInterface;
    320327end;
    321328
     
    370377  LoadConfig(Core.XMLConfig1, 'FormClient');
    371378  Core.PersistentForm.Load(Self);
    372   ReloadView;
     379  UpdateInterface;
    373380  Redraw;
    374381end;
  • trunk/Forms/UFormMain.lfm

    r181 r203  
    11object FormMain: TFormMain
    2   Left = 447
     2  Left = 801
    33  Height = 621
    4   Top = 303
     4  Top = 352
    55  Width = 775
    66  Caption = 'xTactics'
    7   ClientHeight = 596
     7  ClientHeight = 587
    88  ClientWidth = 775
    9   DesignTimePPI = 120
     9  DesignTimePPI = 144
    1010  Menu = MainMenu1
    1111  OnClose = FormClose
     
    1313  OnDestroy = FormDestroy
    1414  OnShow = FormShow
    15   LCLVersion = '1.8.0.6'
     15  LCLVersion = '1.8.2.0'
    1616  WindowState = wsMaximized
    1717  object ToolBar1: TToolBar
     
    7777  object PanelMain: TPanel
    7878    Left = 0
    79     Height = 556
     79    Height = 547
    8080    Top = 40
    8181    Width = 775
     
    9292      object MenuItem2: TMenuItem
    9393        Action = Core.AGameNew
     94        Caption = 'New...'
    9495      end
    9596      object MenuItem3: TMenuItem
     
    99100        Action = Core.AGameRestart
    100101      end
    101       object MenuItem4: TMenuItem
    102         Action = Core.AGameEndTurn
    103       end
    104102      object MenuItem14: TMenuItem
    105103        Action = Core.AGameLoad
     
    110108      object MenuItem15: TMenuItem
    111109        Action = Core.AGameSave
     110        ShortCut = 16467
     111      end
     112      object MenuItem29: TMenuItem
     113        Action = Core.AGameSaveAs
     114        Caption = 'Save as'
     115        ShortCut = 24659
    112116      end
    113117      object MenuItem5: TMenuItem
  • trunk/Forms/UFormMain.pas

    r196 r203  
    4343    MenuItem27: TMenuItem;
    4444    MenuItem28: TMenuItem;
     45    MenuItem29: TMenuItem;
    4546    MenuItemLoadRecent: TMenuItem;
    4647    MenuItem3: TMenuItem;
    47     MenuItem4: TMenuItem;
    4848    MenuItem5: TMenuItem;
    4949    MenuItem6: TMenuItem;
  • trunk/Languages/xtactics.cs.po

    r202 r203  
    99"MIME-Version: 1.0\n"
    1010"Content-Transfer-Encoding: 8bit\n"
    11 "X-Generator: Poedit 1.8.8\n"
     11"X-Generator: Poedit 2.0.6\n"
    1212"Language: cs\n"
    1313
     
    3535msgstr "Ukončit hru"
    3636
    37 #: tcore.agameendturn.caption
    38 msgctxt "TCORE.AGAMEENDTURN.CAPTION"
    39 msgid "End turn"
    40 msgstr "Ukončit tah"
    41 
    42 #: tcore.agameendturn.hint
    43 msgid "End player turn"
    44 msgstr "Ukončit tah hráče"
    45 
    4637#: tcore.agameload.caption
    4738msgid "Load"
     
    7162msgstr "Uložit"
    7263
     64#: tcore.agamesaveas.caption
     65msgid "Save as..."
     66msgstr ""
     67
    7368#: tcore.ahelp.caption
    7469msgctxt "tcore.ahelp.caption"
     
    153148
    154149#: tformclient.agameendturn.caption
    155 #, fuzzy
    156150msgctxt "tformclient.agameendturn.caption"
    157151msgid "End turn"
     
    242236msgstr "Nápověda"
    243237
     238#: tformmain.menuitem2.caption
     239msgid "New..."
     240msgstr ""
     241
    244242#: tformmain.menuitem22.caption
    245243msgctxt "tformmain.menuitem22.caption"
    246244msgid "Statusbar visible"
    247245msgstr "Viditelná stavová lišta"
     246
     247#: tformmain.menuitem29.caption
     248msgid "Save as"
     249msgstr ""
    248250
    249251#: tformmain.menuitem8.caption
     
    970972msgid "64-bit UInt read overflow."
    971973msgstr "Přetečení při čtení 64-bit UInt"
    972 
  • trunk/Languages/xtactics.po

    r202 r203  
    2525msgstr ""
    2626
    27 #: tcore.agameendturn.caption
    28 msgctxt "TCORE.AGAMEENDTURN.CAPTION"
    29 msgid "End turn"
    30 msgstr ""
    31 
    32 #: tcore.agameendturn.hint
    33 msgid "End player turn"
    34 msgstr ""
    35 
    3627#: tcore.agameload.caption
    3728msgid "Load"
     
    6152msgstr ""
    6253
     54#: tcore.agamesaveas.caption
     55msgid "Save as..."
     56msgstr ""
     57
    6358#: tcore.ahelp.caption
    6459msgctxt "TCORE.AHELP.CAPTION"
     
    231226msgstr ""
    232227
     228#: tformmain.menuitem2.caption
     229msgid "New..."
     230msgstr ""
     231
    233232#: tformmain.menuitem22.caption
    234233msgctxt "tformmain.menuitem22.caption"
    235234msgid "Statusbar visible"
     235msgstr ""
     236
     237#: tformmain.menuitem29.caption
     238msgid "Save as"
    236239msgstr ""
    237240
  • trunk/UClientAI.pas

    r202 r203  
    1717    //Targets: TFPGObjectList<TPlayer>;
    1818    CellProcessDirection: Boolean;
    19     Player: TPlayer;
    2019    procedure AttackNeutral;
    2120    procedure AttackPlayers;
     
    3433procedure TComputer.DoTurnStart(Sender: TObject);
    3534begin
    36   inherited DoTurnStart(Sender);
     35  Process;
     36  Protocol.TurnEnd;
    3737end;
    3838
     
    8989          if NeighborCell.GetAvialPower < AttackPower then
    9090            AttackPower := NeighborCell.GetAvialPower;
    91           Self.Player.SetMove(NeighborCell, Cell, AttackPower, False);
     91          ControlPlayer.SetMove(NeighborCell, Cell, AttackPower, False);
    9292          TotalAttackPower := TotalAttackPower + AttackPower;
    9393        end;
     
    109109  NeighborCell: TCell;
    110110begin
    111   if Player.Defensive then Exit;
     111  if ControlPlayer.Defensive then Exit;
    112112
    113113  AllCells := Game.Map.Cells;
     
    117117  // Get list of all attack target cells
    118118  for TargetCell in AllCells do begin
    119     if (TargetCell.Terrain <> ttVoid) and (TargetCell.Player <> Player) and
     119    if (TargetCell.Terrain <> ttVoid) and (TargetCell.Player <> ControlPlayer) and
    120120      (TargetCell.Player <> nil) then begin
    121121      CanAttack := 0;
    122122      for NeighborCell in TargetCell.Neighbors do
    123       if NeighborCell.Player = Player then begin
     123      if NeighborCell.Player = ControlPlayer then begin
    124124        Inc(CanAttack);
    125125      end;
     
    137137      TotalPower := 0;
    138138      for NeighborCell in TargetCell.Neighbors do
    139       if NeighborCell.Player = Player then begin
     139      if NeighborCell.Player = ControlPlayer then begin
    140140        TotalPower := TotalPower + NeighborCell.GetAvialPower;
    141141      end;
    142142      // Attack if target is weaker
    143143      if Game.AttackProbability(TotalPower, TargetCell.Power) >=
    144         ComputerAggroProbability[Player.Agressivity] then begin
     144        ComputerAggroProbability[ControlPlayer.Agressivity] then begin
    145145        // Try to limit total attacking power to necessary minimum
    146146        while Game.AttackProbability(TotalPower - 1, TargetCell.Power) >=
    147           ComputerAggroProbability[Player.Agressivity] do
     147          ComputerAggroProbability[ControlPlayer.Agressivity] do
    148148          Dec(TotalPower);
    149149
     
    151151        TotalAttackPower := 0;
    152152        for NeighborCell in TargetCell.Neighbors do
    153         if NeighborCell.Player = Player then begin
     153        if NeighborCell.Player = ControlPlayer then begin
    154154          // Use only necessary power
    155155          AttackPower := TotalPower - TotalAttackPower;
    156156          if NeighborCell.GetAvialPower < AttackPower then
    157157            AttackPower := NeighborCell.GetAvialPower;
    158           Self.Player.SetMove(NeighborCell, TargetCell, AttackPower, False);
     158          Self.ControlPlayer.SetMove(NeighborCell, TargetCell, AttackPower, False);
    159159          TotalAttackPower := TotalAttackPower + AttackPower;
    160160          if TotalAttackPower >= TotalPower then Break;
     
    258258begin
    259259  // If available power remains then use all for existed unit moves
    260   for Move in Player.Moves do
     260  for Move in ControlPlayer.Moves do
    261261  with Move do begin
    262262    if CellFrom.GetAvialPower > 0 then begin
  • trunk/UCore.lfm

    r197 r203  
    33  OnDestroy = DataModuleDestroy
    44  OldCreateOrder = False
    5   Height = 676
    6   HorizontalOffset = 275
    7   VerticalOffset = 190
    8   Width = 1048
    9   PPI = 120
     5  Height = 811
     6  HorizontalOffset = 330
     7  VerticalOffset = 228
     8  Width = 1258
     9  PPI = 144
    1010  object ActionList1: TActionList
    1111    Images = ImageListSmall
    12     left = 114
    13     top = 50
     12    left = 137
     13    top = 60
    1414    object AExit: TAction
    1515      Caption = 'Exit'
     
    2020    end
    2121    object AGameNew: TAction
     22      Category = 'Game'
    2223      Caption = 'New'
    2324      Hint = 'New game'
     
    2728    end
    2829    object AGameEnd: TAction
     30      Category = 'Game'
    2931      Caption = 'End'
    3032      Hint = 'End game'
     
    3335      ShortCut = 16454
    3436    end
    35     object AGameEndTurn: TAction
    36       Caption = 'End turn'
    37       Hint = 'End player turn'
    38       ImageIndex = 0
    39       OnExecute = AGameEndTurnExecute
    40       ShortCut = 16468
    41     end
    4237    object AGameRestart: TAction
     38      Category = 'Game'
    4339      Caption = 'Restart'
    4440      Hint = 'Restart game'
     
    5450      ShortCut = 120
    5551    end
    56     object AGameSave: TAction
    57       Caption = 'Save'
     52    object AGameSaveAs: TAction
     53      Category = 'Game'
     54      Caption = 'Save as...'
    5855      ImageIndex = 11
    59       OnExecute = AGameSaveExecute
     56      OnExecute = AGameSaveAsExecute
    6057      ShortCut = 16467
    6158    end
    6259    object AGameLoad: TAction
     60      Category = 'Game'
    6361      Caption = 'Load'
    6462      ImageIndex = 10
     
    9189      OnExecute = APlayersStatsExecute
    9290    end
     91    object AGameSave: TAction
     92      Category = 'Game'
     93      Caption = 'Save'
     94      ImageIndex = 11
     95      OnExecute = AGameSaveExecute
     96    end
    9397  end
    9498  object ImageListSmall: TImageList
    95     left = 655
    96     top = 350
     99    left = 786
     100    top = 420
    97101    Bitmap = {
    98102      4C690C00000010000000100000000000000000000000E3AA4BD6E5B35EFFE3B1
     
    486490    POFilesFolder = 'Languages'
    487491    OnTranslate = CoolTranslator1Translate
    488     left = 114
    489     top = 363
     492    left = 137
     493    top = 436
    490494  end
    491495  object ImageListLarge: TImageList
    492496    Height = 32
    493497    Width = 32
    494     left = 655
    495     top = 238
     498    left = 786
     499    top = 286
    496500    Bitmap = {
    497501      4C690C0000002000000020000000000000000000000000000000E2AA4B36E2A9
     
    20382042    RootName = 'CONFIG'
    20392043    ReadOnly = False
    2040     left = 114
    2041     top = 463
     2044    left = 137
     2045    top = 556
    20422046  end
    20432047  object OpenDialog1: TOpenDialog
    20442048    DefaultExt = '.xtmap'
    2045     left = 938
    2046     top = 243
     2049    left = 1126
     2050    top = 292
    20472051  end
    20482052  object SaveDialog1: TSaveDialog
    20492053    DefaultExt = '.xtmap'
    2050     left = 938
    2051     top = 138
     2054    left = 1126
     2055    top = 166
    20522056  end
    20532057  object ApplicationInfo: TApplicationInfo
     
    20622066    AuthorsName = 'Chronos'
    20632067    AppName = 'xTactics'
    2064     ReleaseDate = 43234
     2068    ReleaseDate = 43238
    20652069    RegistryKey = '\Software\xTactics'
    20662070    RegistryRoot = rrKeyCurrentUser
    20672071    License = 'CC0'
    2068     left = 114
    2069     top = 150
     2072    left = 137
     2073    top = 180
    20702074  end
    20712075  object PersistentForm: TPersistentForm
    20722076    MinVisiblePart = 50
    20732077    EntireVisible = False
    2074     left = 650
    2075     top = 500
     2078    left = 780
     2079    top = 600
    20762080  end
    20772081  object ScaleDPI1: TScaleDPI
    20782082    AutoDetect = False
    2079     left = 113
    2080     top = 563
     2083    left = 136
     2084    top = 676
    20812085  end
    20822086  object LastOpenedList1: TLastOpenedList
    20832087    MaxCount = 10
    20842088    OnChange = LastOpenedList1Change
    2085     left = 114
    2086     top = 250
     2089    left = 137
     2090    top = 300
    20872091  end
    20882092end
  • trunk/UCore.pas

    r202 r203  
    1717  TCore = class(TDataModule)
    1818    AAbout: TAction;
     19    AGameSave: TAction;
    1920    APlayersStats: TAction;
    2021    ANewSpectatorClient: TAction;
     
    2223    AShowCharts: TAction;
    2324    AHelp: TAction;
    24     AGameSave: TAction;
     25    AGameSaveAs: TAction;
    2526    AGameLoad: TAction;
    2627    ApplicationInfo: TApplicationInfo;
     
    2930    AExit: TAction;
    3031    AGameEnd: TAction;
    31     AGameEndTurn: TAction;
    3232    AGameNew: TAction;
    3333    AGameRestart: TAction;
     
    4848    procedure AGameNewExecute(Sender: TObject);
    4949    procedure AGameRestartExecute(Sender: TObject);
     50    procedure AGameSaveAsExecute(Sender: TObject);
    5051    procedure AGameSaveExecute(Sender: TObject);
    5152    procedure AHelpExecute(Sender: TObject);
     
    245246procedure TCore.UpdateActions;
    246247begin
    247   Core.AGameEndTurn.Enabled := Core.Game.Running;
    248248  Core.AGameEnd.Enabled := Core.Game.Running;
    249249end;
     
    276276procedure TCore.AGameEndTurnExecute(Sender: TObject);
    277277begin
    278   Game.NextPlayer;
    279   RedrawClients;
    280   UpdateActions;
     278
    281279end;
    282280
     
    314312end;
    315313
    316 procedure TCore.AGameSaveExecute(Sender: TObject);
     314procedure TCore.AGameSaveAsExecute(Sender: TObject);
    317315begin
    318316  SaveDialog1.Filter := SFileDialogFilter;
     
    323321    LastOpenedList1.AddItem(SaveDialog1.FileName);
    324322  end;
     323end;
     324
     325procedure TCore.AGameSaveExecute(Sender: TObject);
     326begin
     327  if FileExists(Game.FileName) then
     328    Game.SaveToFile(Game.FileName)
     329    else AGameSave.Execute;
    325330end;
    326331
     
    434439
    435440  // Create local LocalClients for human players
     441  LocalClients.Clear;
    436442  for Player in Game.Players do
    437443  with Player do
     
    509515
    510516  // Create local LocalClients for human players
     517  LocalClients.Clear;
    511518  for Player in Game.Players do
    512519  with Player do
  • trunk/UGame.pas

    r202 r203  
    31503150  repeat
    31513151    CurrentPlayer := Players[(Players.IndexOf(CurrentPlayer) + 1) mod Players.Count];
    3152     if Assigned(FOnPlayerChange) then
    3153       FOnPlayerChange(Self);
    31543152  until CurrentPlayer.IsAlive;
     3153  if Assigned(FOnPlayerChange) then
     3154    FOnPlayerChange(Self);
     3155
    31553156  if Players.IndexOf(CurrentPlayer) < Players.IndexOf(PrevPlayer) then begin
    31563157    Inc(TurnCounter);
  • trunk/UGameClient.pas

    r202 r203  
    66
    77uses
    8   Classes, SysUtils, UGame, Forms, fgl, UGameProtocol, UGameServer;
     8  Classes, SysUtils, UGame, Forms, fgl, UGameProtocol, UGameServer, UCommThread;
    99
    1010type
     
    2222    FOnReceive: TCommandEvent;
    2323    FOnMove: TMoveEvent;
     24    FOnTurnStart: TNotifyEvent;
     25    CommThread: TCommThread;
    2426    procedure SetActive(AValue: Boolean);
    2527    procedure SetControlPlayer(AValue: TPlayer);
     
    2830    procedure PlayerMove(CellFrom, CellTo: TCell; var CountOnce, CountRepeat: Integer;
    2931      Update: Boolean; var Confirm: Boolean);
     32    procedure SetOnMove(AValue: TMoveEvent);
    3033  protected
    3134    procedure ReceiveCmd(Command: TCommand; DataOut, DataIn: TStream); virtual;
     
    4548    property Game: TGame read FGame write SetGame;
    4649    property Form: TForm read FForm write SetForm;
    47     property OnMove: TMoveEvent read FOnMove write FOnMove;
     50    property OnMove: TMoveEvent read FOnMove write SetOnMove;
    4851    property OnReceive: TCommandEvent read FOnReceive write FOnReceive;
    4952    property OnChange: TNotifyEvent read FOnChange write FOnChange;
     53    property OnTurnStart: TNotifyEvent read FOnTurnStart write FOnTurnStart;
    5054    property Active: Boolean read FActive write SetActive;
    5155  end;
     
    113117end;
    114118
     119procedure TClient.SetOnMove(AValue: TMoveEvent);
     120begin
     121  //if FOnMove = AValue then Exit;
     122  FOnMove := AValue;
     123end;
     124
    115125procedure TClient.ReceiveCmd(Command: TCommand; DataOut, DataIn: TStream);
    116126begin
     
    120130procedure TClient.DoTurnStart(Sender: TObject);
    121131begin
    122 
     132  if Assigned(FOnTurnStart) then
     133    FOnTurnStart(Self);
    123134end;
    124135
     
    139150begin
    140151  if FActive = AValue then Exit;
     152  if FActive then begin
     153    case ConnectType of
     154      ctLocal: begin
     155        CommThread.Active := False;
     156        CommThread.Ext.Disconnect;
     157        CommThread.Pin.Disconnect;
     158      end;
     159    end;
     160  end;
    141161  FActive := AValue;
    142162  if FActive then begin
    143163    case ConnectType of
    144164      ctLocal: if LocalServer.Active then begin
     165        CommThread.Active := True;
     166        CommThread.Pin.Connect(Protocol.Pin);
    145167        ServerClient := LocalServer.GetNewServerClient;
    146168        ServerClient.Player := ControlPlayer;
    147         ServerClient.Protocol.Pin.Connect(Protocol.Pin);
     169        ServerClient.Protocol.Pin.Connect(CommThread.Ext);
    148170      end else raise Exception.Create('Local server is not active');
    149171      //ctNetwork: ;
     
    162184constructor TClient.Create;
    163185begin
     186  CommThread := TCommThread.Create(nil);
    164187  FControlPlayer := nil;
    165188  View := TView.Create;
     
    173196  FreeAndNil(View);
    174197  FreeAndNil(Protocol);
     198  FreeAndNil(CommThread);
    175199  inherited Destroy;
    176200end;
  • trunk/UGameProtocol.pas

    r202 r203  
    7373begin
    7474  Data := TVarBlockSerializer.Create;
    75   Data.ReadVarList(Stream);
     75  Data.WriteVarList(Stream);
    7676  Data.Stream.Position := 0;
    77   Command := Data.ReadVarSInt;
     77  Command := Data.ReadVarUInt;
    7878  try
    7979    if Command = Integer(cmdTextMessage) then begin
     
    143143  Data.WriteVarList(Stream);
    144144  Data.Stream.Position := 0;
    145   Command := Data.ReadVarSInt;
     145  Command := Data.ReadVarUInt;
    146146  try
    147147    if Command = Integer(cmdGameStart) then begin
  • trunk/UGameServer.pas

    r202 r203  
    203203begin
    204204  Result := TServerClient.Create;
     205  Result.Game := Game;
    205206  Clients.Add(Result);
    206207end;
  • trunk/xtactics.lpi

    r202 r203  
    104104      </Item7>
    105105    </RequiredPackages>
    106     <Units Count="27">
     106    <Units Count="28">
    107107      <Unit0>
    108108        <Filename Value="xtactics.lpr"/>
     
    255255        <IsPartOfProject Value="True"/>
    256256      </Unit26>
     257      <Unit27>
     258        <Filename Value="Packages/PinConnection/UCommThread.pas"/>
     259        <IsPartOfProject Value="True"/>
     260      </Unit27>
    257261    </Units>
    258262  </ProjectOptions>
     
    287291    <Linking>
    288292      <Debugging>
    289         <UseHeaptrc Value="True"/>
     293        <UseExternalDbgSyms Value="True"/>
    290294      </Debugging>
    291295      <Options>
  • trunk/xtactics.lpr

    r202 r203  
    1515{$R *.res}
    1616
    17 {$IFDEF DEBUG}
     17{$if declared(UseHeapTrace)}
    1818const
    1919  HeapTraceLog = 'heaptrclog.trc';
     
    2222
    2323begin
    24   {$IFDEF DEBUG}
     24  {$if declared(UseHeapTrace)}
    2525  // Heap trace
    2626  DeleteFile(ExtractFilePath(ParamStr(0)) + HeapTraceLog);
Note: See TracChangeset for help on using the changeset viewer.