Game Development Community

TGELobby bug with List Channels?

by Dennis De Marco · in Torque Game Engine · 04/13/2006 (10:19 pm) · 0 replies

I have been playing around with TGELobby and ngircd for a backend chat server. I seem to be getting channels listed twice when I click the 'Show channels' Toggle Button.

I've been tracking down this bug and apparently the MyIrc::sendMsg("LIST") is being sent twice, and thus the server is sending the channel list twice.

I think it has to do with the behavior of the toggle button but I am unsure the best way to fix this, or why it executes only twice and stops. I would expect it keep looping since the Toggle button is pressed no?

Any advice would be greatly apperciated. Thanks,

Code below from the TGELobby






Guildlobby.gui
new GuiBitmapButtonCtrl(switch_channels) {
      profile = "GuiButtonProfile";
      horizSizing = "relative";
      vertSizing = "relative";
      position = "436 72";
      extent = "76 20";
      minExtent = "8 2";
      visible = "1";
      command = "ListChannels();";
      text = "Button";
      groupNum = "-1";
      buttonType = "ToggleButton";
      bitmap = "./buttons/switch_rooms";
   };
And in guiLobby.cs ..

function ListChannels(%this)
{
   
if(switch_channels.getValue() $= 1)
   GuiLobby::showChannels(%this);

else
if(switch_channels.getValue() $= 0)
   GuiLobby::goRoom(%this);
}


function GuiLobby::showChannels(%this)
{
// This function brings up the channel list
channel_list.clear();
Channel_List_Dlg.setVisible(true);
myIrc::sendMsg("LIST");
switch_channels.setBitmap($TgeLobby::Directory@$TgeLobby::ButtonsDir@"go_channel");

if($pref::Chat::Channel !$= "")
   myIrc::sendMsg("NAMES "@$pref::Chat::Channel);
}