타입 미스매치 수정
This commit is contained in:
@ -322,19 +322,17 @@ func (sh *subhandler) mainLoop(ctx context.Context) {
|
||||
|
||||
case *commandMessage:
|
||||
if usermsg.Cmd == commandType_JoinRoom && len(usermsg.Args) == 2 {
|
||||
accid := usermsg.Args[0].(string)
|
||||
roomName := usermsg.Args[1].(string)
|
||||
|
||||
conn := entireConns[accid]
|
||||
roomName := usermsg.Args[0].(string)
|
||||
accid := usermsg.Args[1].(primitive.ObjectID)
|
||||
conn := entireConns[accid.Hex()]
|
||||
if conn != nil {
|
||||
findRoom(roomName, true).in(conn)
|
||||
break
|
||||
}
|
||||
} else if usermsg.Cmd == commandType_LeaveRoom && len(usermsg.Args) == 2 {
|
||||
accid := usermsg.Args[0].(string)
|
||||
roomName := usermsg.Args[1].(string)
|
||||
|
||||
conn := entireConns[accid]
|
||||
roomName := usermsg.Args[0].(string)
|
||||
accid := usermsg.Args[1].(primitive.ObjectID)
|
||||
conn := entireConns[accid.Hex()]
|
||||
if conn != nil {
|
||||
if room := findRoom(roomName, false); room != nil {
|
||||
room.out(conn)
|
||||
@ -376,18 +374,16 @@ func (sh *subhandler) mainLoop(ctx context.Context) {
|
||||
|
||||
case *commandMessage:
|
||||
if usermsg.Cmd == commandType_JoinRoom && len(usermsg.Args) == 2 {
|
||||
accid := usermsg.Args[0].(string)
|
||||
roomName := usermsg.Args[1].(string)
|
||||
|
||||
conn := entireConns[accid]
|
||||
roomName := usermsg.Args[0].(string)
|
||||
accid := usermsg.Args[1].(primitive.ObjectID)
|
||||
conn := entireConns[accid.Hex()]
|
||||
if conn != nil {
|
||||
findRoom(roomName, true).in(conn)
|
||||
}
|
||||
} else if usermsg.Cmd == commandType_LeaveRoom && len(usermsg.Args) == 2 {
|
||||
accid := usermsg.Args[0].(string)
|
||||
roomName := usermsg.Args[1].(string)
|
||||
|
||||
conn := entireConns[accid]
|
||||
roomName := usermsg.Args[0].(string)
|
||||
accid := usermsg.Args[1].(primitive.ObjectID)
|
||||
conn := entireConns[accid.Hex()]
|
||||
if conn != nil {
|
||||
if room := findRoom(roomName, false); room != nil {
|
||||
room.out(conn)
|
||||
|
||||
Reference in New Issue
Block a user