mirror of
https://github.com/deavmi/birchwood
synced 2024-09-20 13:43:19 +02:00
Merge branch 'master' into bugfix/improve_snoosy
This commit is contained in:
commit
ed39b950c3
@ -10,7 +10,7 @@ import std.container.slist : SList;
|
|||||||
import core.sync.mutex : Mutex;
|
import core.sync.mutex : Mutex;
|
||||||
import core.thread : Thread, dur;
|
import core.thread : Thread, dur;
|
||||||
import std.string;
|
import std.string;
|
||||||
import eventy : EventyEvent = Event, Engine, EventType, Signal;
|
import eventy : EventyEvent = Event, Engine, EventType, Signal, EventyException;
|
||||||
import birchwood.config;
|
import birchwood.config;
|
||||||
import birchwood.client.exceptions : BirchwoodException, ErrorType;
|
import birchwood.client.exceptions : BirchwoodException, ErrorType;
|
||||||
import birchwood.protocol.messages : Message, encodeMessage, decodeMessage, isValidText;
|
import birchwood.protocol.messages : Message, encodeMessage, decodeMessage, isValidText;
|
||||||
@ -649,8 +649,12 @@ public class Client : Thread
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initialize the event handlers
|
* Initialize the event handlers
|
||||||
*/
|
*
|
||||||
|
* Throws:
|
||||||
|
* `EventyException` on error registering
|
||||||
|
* the signals and event types
|
||||||
|
*/
|
||||||
private void initEvents()
|
private void initEvents()
|
||||||
{
|
{
|
||||||
/* TODO: For now we just register one signal type for all messages */
|
/* TODO: For now we just register one signal type for all messages */
|
||||||
@ -775,7 +779,8 @@ public class Client : Thread
|
|||||||
* Connects to the server
|
* Connects to the server
|
||||||
*
|
*
|
||||||
* Throws:
|
* Throws:
|
||||||
* BirchwoodException if there is an error connecting
|
* `BirchwoodException` if there is an error connecting
|
||||||
|
* or something failed internally
|
||||||
*/
|
*/
|
||||||
public void connect()
|
public void connect()
|
||||||
{
|
{
|
||||||
@ -820,6 +825,10 @@ public class Client : Thread
|
|||||||
{
|
{
|
||||||
throw new BirchwoodException(ErrorType.CONNECT_ERROR);
|
throw new BirchwoodException(ErrorType.CONNECT_ERROR);
|
||||||
}
|
}
|
||||||
|
catch(EventyException e)
|
||||||
|
{
|
||||||
|
throw new BirchwoodException(ErrorType.INTERNAL_FAILURE, e.toString());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// TODO: Do actual liveliness check here
|
// TODO: Do actual liveliness check here
|
||||||
else
|
else
|
||||||
|
@ -15,6 +15,13 @@ import std.conv : to;
|
|||||||
*/
|
*/
|
||||||
public enum ErrorType
|
public enum ErrorType
|
||||||
{
|
{
|
||||||
|
/**
|
||||||
|
* This could occur from errors with `Eventy`
|
||||||
|
* when setting up the signal handlers and
|
||||||
|
* event types
|
||||||
|
*/
|
||||||
|
INTERNAL_FAILURE,
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* If the provided connection information
|
* If the provided connection information
|
||||||
* is invalid, such as incorrect hostname,
|
* is invalid, such as incorrect hostname,
|
||||||
|
Loading…
Reference in New Issue
Block a user