本文整理汇总了C#中Instance.Connect方法的典型用法代码示例。如果您正苦于以下问题:C# Instance.Connect方法的具体用法?C# Instance.Connect怎么用?C# Instance.Connect使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Instance
的用法示例。
在下文中一共展示了Instance.Connect方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Create
public IInstance Create(Configuration.ISettings configurationSettings)
{
Instance instance = new Instance(configurationSettings, _connectionFactory, _messageSerializer);
instance.Connect();
return instance;
}
示例2: Main
static void Main(string[] args)
{
var vp = new Instance();
vp.Connect();
vp.Login("trooper", "", "jeeves");
vp.Enter("Blizzard");
Console.WriteLine("online");
vp.UpdateAvatar();
vp.UseAutoWaitTimer = true;
vp.OnAvatarEnter += vp_OnAvatarEnter;
vp.OnAvatarChange += vp_OnAvatarChange;
vp.OnChatMessage += vp_OnChatMessage;
while (true) // Loop indefinitely
{
Console.WriteLine("Enter input:"); // Prompt
string line = Console.ReadLine(); // Get string from user
if (line == "exit") // Check string
{
break; // exit program
}
else if (line == "hello") // Check string
{
//test command to show status and see if broken
Console.WriteLine("hello trooper");
}
else if (line == "edit terrain") // Check string
{
//change terrain height to bottom of troopers feet
//feather out from trooper
}
else if (line.StartsWith("say"))
{
vp.Say(line.Remove(0, 4));
Console.WriteLine(line);
}
else if (line == "start city")
{
vp.OnAvatarClick += vp_OnAvatarClick;
vp.Say("everyone has been given guns");
}
else if (line == "list players")
{
Console.WriteLine("\nCapacity: {0}", storage.stats.Capacity);
Console.WriteLine("Count: {0}", storage.stats.Count);
}
else
{
Console.Write("You typed "); // Report output
Console.Write(line.Length); // length of line
Console.WriteLine(" characters and i didnt understand one");
}
}
}