Added Documentation and error handling

error handling mainly includes the socket errors and wrong server input
errors. the former is set to return to mainscreen, need weilong to
implement the screen switching. Tagged as TODO. the latter has 2 types,
the ignorable where the game will continue without parsing, and the
unignorable, which also returns to main screen