All pastes #912503 Raw Edit

Something

public text v1 · immutable
·published 2008-02-21 12:48 UTC
rendered paste body
// run on game start

  if BattleState.Battle.NATType = 1 then  // "hole punching" method
  begin
    // let's acquire our public UDP source port from the server:
    InitWaitForm.ChangeCaption(MSG_GETHOSTPORT);
    InitWaitForm.TakeAction := 2; // get host port
    res := InitWaitForm.ShowModal;
    if res <> mrOK then
    begin
      MessageDlg('Unable to acquire UDP source port from server. Try choosing another NAT traversal technique!', mtWarning, [mbOK], 0);
      Exit;
    end;
  end;
  PostMessage(BattleForm.Handle, WM_STARTGAME, 0, 0);
end;