public void EnterConnected() { connection.OpenChannel(); state.Reset(); var scv = new CNETMsg_SetConVar(); scv.convars = state.ExposeCVars(); var scvMessage = DotaGameConnection.ConvertProtoToMessage( (uint)NET_Messages.net_SetConVar, scv); var ss = new CNETMsg_SignonState(); ss.num_server_players = 0; ss.spawn_count = 0xFFFFFFFF; ss.signon_state = (uint)SIGNONSTATE.SIGNONSTATE_CONNECTED; var ssMessage = DotaGameConnection.ConvertProtoToMessage( (uint)NET_Messages.net_SignonState, ss); connection.SendReliably(scvMessage, ssMessage); }
public void EnterGame() { var ack = new CCLCMsg_BaselineAck(); ack.baseline_nr = state.Baseline; ack.baseline_tick = (int)state.ServerTick; var ackMsg = DotaGameConnection.ConvertProtoToMessage( (uint)CLC_Messages.clc_BaselineAck, ack); var ss = new CNETMsg_SignonState(); ss.num_server_players = 0; ss.signon_state = (uint)SIGNONSTATE.SIGNONSTATE_FULL; ss.spawn_count = state.ServerCount; var ssMessage = DotaGameConnection.ConvertProtoToMessage( (uint)NET_Messages.net_SignonState, ss); var le = new CCLCMsg_ListenEvents(); for (uint i = 0; i < 267; i += 32) { le.event_mask.Add(0xffffffff); } le.event_mask.Add(0x000003ff); var leMessage = DotaGameConnection.ConvertProtoToMessage( (uint)CLC_Messages.clc_ListenEvents, le); connection.SendReliably(ackMsg, ssMessage, leMessage); var clientMsgs = new List <DotaGameConnection.Message>(); for (var i = 0; i < 10; ++i) { var msg = new CCLCMsg_ClientMessage(); msg.data = new byte[] { 0x0D, 0xCD, 0xCC, 0xCC, 0x3F }; msg.msg_type = 2; var msgMessage = DotaGameConnection.ConvertProtoToMessage( (uint)CLC_Messages.clc_ClientMessage, msg); clientMsgs.Add(msgMessage); } connection.SendUnreliably(clientMsgs.ToArray()); }
public void Submit(string consoleCommand) { var cmd = new CNETMsg_StringCmd(); cmd.command = consoleCommand; connection.SendReliably(DotaGameConnection.ConvertProtoToMessage((uint)NET_Messages.net_StringCmd, cmd)); }