Example #1
0
        public void EnterNew()
        {
            var ci = new CCLCMsg_ClientInfo();
            ci.server_count = state.ServerCount;
            var ciMessage = DotaGameConnection.ConvertProtoToMessage(
                (uint) CLC_Messages.clc_ClientInfo,
                ci);

            var ss = new CNETMsg_SignonState();
            ss.signon_state = (uint) SIGNONSTATE.SIGNONSTATE_NEW;
            ss.spawn_count = state.ServerCount;
            ss.num_server_players = 0;

            var ssMessage = DotaGameConnection.ConvertProtoToMessage(
                (uint) NET_Messages.net_SignonState,
                ss);

            var scv = new CNETMsg_SetConVar();
            scv.convars = new CMsg_CVars();
            var cvar = new CMsg_CVars.CVar();
            cvar.name = "steamworks_sessionid_client";
            cvar.value = details.SteamworksSessionId.ToString();
            state.CVars["steamworks_sessionid_client"] = details.SteamworksSessionId.ToString();
            scv.convars.cvars.Add(cvar);

            var scvMessage = DotaGameConnection.ConvertProtoToMessage(
                (uint) NET_Messages.net_SetConVar,
                scv);

            connection.SendReliably(ciMessage, ssMessage, scvMessage);
        }
Example #2
0
        private Events? Handle(CNETMsg_SetConVar message)
        {
            foreach (var cvar in message.convars.cvars)
            {
                state.CVars[cvar.name] = cvar.value;
            }

            return null;
        }
Example #3
0
        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);
        }