What's wrong with my Nighttime command(impulse's source)

07/18/2010 19:42 MonstersAbroad#1
Heres my command
Code:
#region Night
                                    case "night":
                                        {
                                            Client.GameState.ScreenColor = 5855577;
                                            GamePackets.GeneralData Packet = new GamePackets.GeneralData(true);
                                            Packet.UID = client.Entity.UID;
                                            Packet.GetType();
                                            Packet.ID = (ushort)Client.GameState.ScreenColor;
                                            foreach (Client.GameState pclient in ServerBase.Kernel.GamePool.Values)
                                            {
                                                pclient.Send(Packet);
                                            }
                                            //pclient.Send(GeneralData(pclient.Entity.UID, Client.GameState.ScreenColor, 0, 0, 104));
                                            //pclient.Send(GamePackets.GeneralData(pclient.Entity.UID, Client.GameState.ScreenColor, 0, 0, 104));
                                        }
                                        break;
                                    #endregion
Been at this for 3 hours or so and nothing seems to work :(
07/21/2010 22:03 MonstersAbroad#2
#bump
07/21/2010 22:12 _tao4229_#3
If I understand the source correctly (never opened it before) you're setting the ID wrong. The ID should be 104 and the "value" of the packet should be the color.
07/21/2010 22:27 MonstersAbroad#4
Something like
Code:
Client.GameState.ScreenColor = 5855577;
                                            GamePackets.GeneralData Packet = new GamePackets.GeneralData(true);
                                            Packet.UID = client.Entity.UID;
                                            Packet.GetType();
                                            Packet.ID = 104;
                                            Packet.dwParam = Client.GameState.ScreenColor;
                                            foreach (Client.GameState pclient in ServerBase.Kernel.GamePool.Values)
                                            {
                                                pclient.Send(Packet);
                                            }
?

#edit
Or this?
Code:
                                            Client.GameState.ScreenColor = 5855577;
                                            GamePackets.GeneralData Packet = new GamePackets.GeneralData(true);
                                            Packet.UID = client.Entity.UID;
                                            Packet.GetType();
                                            Packet.ID = 104;
                                            Packet.dwParam = Client.GameState.ScreenColor;
                                            Packet.wParam1 = 0;
                                            Packet.wParam2 = 0;
                                            foreach (Client.GameState pclient in ServerBase.Kernel.GamePool.Values)
                                            {
                                                pclient.Send(Packet);
                                            }
07/21/2010 23:15 -impulse-#5
Hmm, what's GetType()?

and it should be ...


Client.GameState.ScreenColor = 5855577;
GamePackets.GeneralData Packet = new GamePackets.GeneralData(true);
Packet.UID = client.Entity.UID;
Packet.ID = 104;
Packet.dwParam = Client.GameState.ScreenColor;
foreach (Client.GameState pclient in ServerBase.Kernel.GamePool.Values)
{
pclient.Send(Packet);
}