コード例 #1
0
        internal KartPlayer(plrinfo plr)
        {
            Node = plr.node;

            unsafe
            {
                Name = KartUtils.DecodeString(plr.name, plrinfo.MAX_PLAYER_NAME_LENGTH);
            }

            Team         = plr.team;
            Skin         = plr.skin;
            Data         = plr.data;
            Score        = plr.score;
            TimeInServer = TimeSpan.FromSeconds(plr.timeinserver);
        }
コード例 #2
0
        internal KartMap(serverinfo_pak srv)
        {
            unsafe
            {
                InternalName = KartUtils.DecodeString(srv.mapname, serverinfo_pak.MAX_MAP_NAME_LENGTH);

                Title = KartUtils.DecodeString(srv.maptitle, serverinfo_pak.MAX_MAP_TITLE_LENGTH);

                MD5 = new byte[16];
                for (var i = 0; i < 16; i++)
                {
                    MD5[i] = srv.mapmd5[i];
                }
            }

            ActNumber = srv.actnum;
            IsZone    = srv.iszone == 0 || srv.iszone == 1
                ? srv.iszone == 1
                : throw new ArgumentOutOfRangeException(nameof(srv.iszone));
            TimeElapsed = TimeSpan.FromSeconds(srv.leveltime / (double)KartUtils.SRB2_TICRATE);
        }