static void SendNPCGFUpdateChar(Character ch, uint charid) { byte[] omsg = { 0x26, 0x02 }; FLMsgType.AddUInt32(ref omsg, 68 + (uint)ch.FidgetScript.Length + (uint)ch.RoomLocation.Length); FLMsgType.AddUInt32(ref omsg, charid); FLMsgType.AddUInt32(ref omsg, 0); // 1 = player, 0 = npc FLMsgType.AddUInt32(ref omsg, ch.RoomID); FLMsgType.AddUInt32(ref omsg, ch.IndividualName); // npc name FLMsgType.AddUInt32(ref omsg, FLUtility.CreateFactionID(ch.Faction)); // faction FLMsgType.AddInt32(ref omsg, -1); FLMsgType.AddUInt32(ref omsg, ch.Head); FLMsgType.AddUInt32(ref omsg, ch.Body); FLMsgType.AddUInt32(ref omsg, ch.Lefthand); FLMsgType.AddUInt32(ref omsg, ch.Righthand); FLMsgType.AddUInt32(ref omsg, 0); // accessories count + list FLMsgType.AddAsciiStringLen32(ref omsg, ch.FidgetScript); FLMsgType.AddUInt32(ref omsg, charid); // behaviourid if (ch.RoomLocation.Length == 0) { FLMsgType.AddInt32(ref omsg, -1); } else { FLMsgType.AddAsciiStringLen32(ref omsg, ch.RoomLocation); } FLMsgType.AddUInt32(ref omsg, 0x00); // 1 = player, 0 = npc FLMsgType.AddUInt32(ref omsg, 0x00); // 1 = sitlow, 0 = stand FLMsgType.AddUInt32(ref omsg, ch.Voice); // voice Context.Sender.Tell(omsg); }
public void Handle(PlayerStatsRequest message) { byte[] omsg = { 0x18, 0x01 }; FLMsgType.AddInt32(ref omsg, (13 * 4) + (_account.Reputations.Count * 8) + (_account.Kills.Count * 8)); // FLMsgType.AddUInt32(ref omsg, 4); // rm_completed FLMsgType.AddUInt32(ref omsg, 0); // u_dword FLMsgType.AddUInt32(ref omsg, 2); // rm_failed FLMsgType.AddUInt32(ref omsg, 0); // u_dword FLMsgType.AddFloat(ref omsg, 10000.0f); // total_time_played FLMsgType.AddUInt32(ref omsg, 6); // systems_visited FLMsgType.AddUInt32(ref omsg, 5); // bases_visited FLMsgType.AddUInt32(ref omsg, 4); // holes_visited FLMsgType.AddInt32(ref omsg, _account.Kills.Count); // kills_cnt FLMsgType.AddUInt32(ref omsg, _account.Rank); // rank FLMsgType.AddUInt32(ref omsg, (UInt32)_account.Money); // current_worth FLMsgType.AddUInt32(ref omsg, 0); // dunno FLMsgType.AddInt32(ref omsg, _account.Reputations.Count); foreach (var pi in _account.Kills) { FLMsgType.AddUInt32(ref omsg, pi.Key); FLMsgType.AddUInt32(ref omsg, pi.Value); } foreach (var pi in _account.Reputations) { //TODO: check hash FLMsgType.AddUInt32(ref omsg, FLUtility.CreateFactionID(pi.Key)); FLMsgType.AddFloat(ref omsg, pi.Value); } _socket.Tell(omsg); }
// <summary> /// Load the factions from initial world. /// </summary> /// <param name="path"></param> private static void LoadFactions(string path, ILogController log) { var ini = new FLDataFile(path, true); foreach (FLDataFile.Section sec in ini.Sections) { string sectionName = sec.SectionName.ToLowerInvariant(); if (sectionName == "group") { var faction = new Faction { Nickname = sec.GetSetting("nickname").Str(0) }; faction.FactionID = FLUtility.CreateFactionID(faction.Nickname); Factions[faction.Nickname] = faction; } } }